package com.seda.fdc.ejb.reports.pdfgenerator.lowagie.text.image;

import java.io.IOException;
import java.net.MalformedURLException;

import com.lowagie.text.BadElementException; 
import com.lowagie.text.DocumentException;
import com.lowagie.text.Utilities;
import com.lowagie.text.pdf.PdfContentByte;

public class SimpleImage extends AbstractImage {

	

	public SimpleImage(String path) throws BadElementException, MalformedURLException, IOException{
		super(path);
	}
	public SimpleImage(byte[] buffer) throws BadElementException,
			MalformedURLException, IOException {
		super(buffer); 
	}

	

	public void scaleAbsolute(float mmNewWidth, float mmNewHeight){
		super.scaleAbsolute(Utilities.millimetersToPoints(mmNewWidth),
				Utilities.millimetersToPoints(mmNewHeight));
	}
 
 
	public void scaleToFit(float mmFitWidth, float mmFitHeight){
		super.scaleToFit(Utilities.millimetersToPoints(mmFitWidth),
				Utilities.millimetersToPoints(mmFitHeight));
	}	
	

	public void scaleToFitWidth(float mmFitWidth){
		super.scaleToFitWidth(Utilities.millimetersToPoints(mmFitWidth) );
	}	
	
		
	
	
	public void setAbsolutePosition(float mmX, float mmY, PdfContentByte content) throws DocumentException{
		super.setAbsolutePosition(Utilities.millimetersToPoints(mmX),
				Utilities.millimetersToPoints(mmY), content);
	}
	
	

	public void setAbsolutePositionTop(float millimitersX, float millimitersY, PdfContentByte pdfContentByte, float pageHeightMillimiters) throws DocumentException{ 
		super.setAbsolutePosition(Utilities.millimetersToPoints(millimitersX), 
				Utilities.millimetersToPoints(pageHeightMillimiters -  millimitersY), pdfContentByte);  
	}
	
}
